let Mock = require('mockjs');
let Random = Mock.Random;

const ztest = function () {
	let arr = [];
  for (let i = 0; i < 10; i++) {
    let attr = {
      title: Random.csentence(5, 30), //  Random.csentence( min, max )
      thumbnail_pic_s: Random.image('300x250'), // Random.dataImage( size, text ) 生成一段随机的 Base64 图片编码
      author_name: Random.cname(), // Random.cname() 随机生成一个常见的中文姓名
      date: Random.date() + ' ' + Random.time() // Random.date()指示生成的日期字符串的格式,默认为yyyy-MM-dd；Random.time() 返回一个随机的时间字符串
    }
    arr.push(attr)
  }

  return {
  	status: '0',
    data: arr
  }
}

const zInvoiceByCode = function () {
	let _obj = {
		code: Random.string('number', 8),
		price: Random.integer(1000, 10000),
		company: Random.cword(2, 5),
		medlist: []
	}
	for (let i = 0; i < 2; i++) {
	  let attr = {
	  	name: '药品'+Random.integer(11, 20),
	  	specifications: Random.float(0.1, 1).toFixed(1)+'mg X '+Random.integer(5, 10).toFixed(1)+'ml',
	  	factory: Random.cword(2, 5),
	  	batchnumber: Random.string('number', 20),
	  	validity: Random.integer(3, 36),
	  	productdate: Random.date('yyyy-MM-dd'),
	  	unitprice: Random.integer(5, 150),
	  	num: Random.integer(200, 1000),
	  	price: Random.integer(1000, 10000)
	  }
	  _obj.medlist.push(attr)
	}

  return {
  	status: '0',
    data: _obj
  }
}

const zInvoiceSave = function () {
  return {
  	status: '0',
    data: {}
  }
}

const zInvoiceList = function () {
	let arr = [];
	for(let j = 0; j < 5; j++) {
		let _obj = {
			code: Random.string('number', 8),
			price: Random.integer(1000, 10000),
			company: Random.cword(2, 5),
			reviewman: Random.cword(2, 5),
			status: Random.boolean() ? 'Y' : 'N',
			medlist: []
		}
		const len = Random.integer(0, 10);
		for (let i = 0; i < len; i++) {
		  let attr = {
		  	name: '药品'+Random.integer(11, 20),
		  	specifications: Random.float(0.1, 1).toFixed(1)+'mg X '+Random.integer(5, 10).toFixed(1)+'ml',
		  	factory: Random.cword(2, 5),
		  	batchnumber: Random.string('number', 20),
		  	validity: Random.integer(3, 36),
		  	productdate: Random.date('yyyy-MM-dd'),
		  	unitprice: Random.integer(5, 150),
		  	num: Random.integer(200, 1000),
		  	price: Random.integer(1000, 10000)
		  }
		  _obj.medlist.push(attr)
		}
		arr.push(_obj);
	}

  return {
  	status: '0',
    data: {
			total: 10,
			list: arr
		}
  }
}

const zSupplierList = function () {
	let arr = [];
	const len = Random.integer(1, 10);
	for (let i = 0; i < len; i++) {
		let attr = {
			id: Random.id(),
			name: '供应商'+Random.cword(2, 5),
		}
		arr.push(attr)
	}

  return {
  	status: '0',
    data: arr
  }
}

const zMedcheckByCode = function () {
	let arr = [];
	const len = Random.integer(0, 10);
	for (let i = 0; i < len; i++) {
		let attr = {
			id: Random.id(),
			name: '药品'+Random.integer(11, 20),
			specifications: Random.float(0.1, 1).toFixed(1)+'mg X '+Random.integer(5, 10).toFixed(1)+'ml',
			factory: Random.cword(2, 5),
			batchnumber: Random.string('number', 20),
			validity: Random.integer(3, 36),
			productdate: Random.date('yyyy-MM-dd'),
			unitprice: Random.integer(5, 150),
			num: Random.integer(200, 1000),
			smnum: Random.integer(200, 1000),
			price: Random.integer(1000, 10000),
			invoiceCode: Random.string('number', 8),
			drugStorage: '药库'+Random.cword(2, 5)
		}
		arr.push(attr)
	}

  return {
  	status: '0',
    data: {
			list: arr
		}
  }
}

const zMedcheckSave = function () {
  return {
  	status: '0',
    data: {}
  }
}

const zMedcheckList = function () {
	let arr = [];
	for (let i = 0; i < 5; i++) {
		let attr = {
			id: Random.id(),
			name: '药品'+Random.integer(11, 20),
			specifications: Random.float(0.1, 1).toFixed(1)+'mg X '+Random.integer(5, 10).toFixed(1)+'ml',
			factory: Random.cword(2, 5),
			reviewman: Random.cword(2, 5),
			batchnumber: Random.string('number', 20),
			validity: Random.integer(3, 36),
			productdate: Random.date('yyyy-MM-dd'),
			unitprice: Random.integer(5, 150),
			num: Random.integer(200, 1000),
			smnum: Random.integer(200, 1000),
			price: Random.integer(1000, 10000),
			invoiceCode: Random.string('number', 8),
			status: Random.boolean() ? 'Y' : 'N',
			drugStorage: '药库'+Random.cword(2, 5)
		}
		arr.push(attr);
	}

  return {
  	status: '0',
    data: {
			total: 10,
			list: arr
		}
  }
}

const zDrugStorageList = function () {
	let arr = [];
	const len = Random.integer(1, 10);
	for (let i = 0; i < len; i++) {
		let attr = {
			id: Random.id(),
			name: '药库'+Random.cword(2, 5),
		}
		arr.push(attr)
	}

  return {
  	status: '0',
    data: arr
  }
}

const zOutStoreList = function () {
	let arr = [];
	const len = Random.integer(1, 10);
	for (let i = 0; i < len; i++) {
		let attr = {
			id: Random.id(),
			name: '药库'+Random.cword(2, 5),
			type: Random.integer(0, 2)
		}
		arr.push(attr)
	}

  return {
  	status: '0',
    data: arr
  }
}

const zCheckresList = function () {
	let arr = [];
	for (let i = 0; i < 5; i++) {
		let attr = {
			id: Random.id(),
			name: '药品'+Random.integer(11, 20),
			specifications: Random.float(0.1, 1).toFixed(1)+'mg X '+Random.integer(5, 10).toFixed(1)+'ml',
			factory: Random.cword(2, 5),
			batchnumber: Random.string('number', 20),
			validity: Random.integer(3, 36),
			productdate: Random.date('yyyy-MM-dd'),
			checkdate: Random.date('yyyy-MM-dd'),
			unitprice: Random.integer(5, 150),
			num: Random.integer(200, 1000),
			smnum: Random.integer(200, 1000),
			price: Random.integer(1000, 10000),
			invoiceCode: Random.string('number', 8),
			statusInv: Random.boolean(),
			statusMed: Random.boolean(),
			supplier: Random.cword(2, 5)
		}
		arr.push(attr);
	}

  return {
  	status: '0',
    data: {
			total: 10,
			list: arr
		}
  }
}

const zBatchresetByCode = function () {
	
	let medlist = [];
	for (let i = 0; i < Random.integer(1, 4); i++) {
		let attr = {
			id: Random.id(),
			name: '药品'+Random.integer(11, 20),
			specifications: Random.float(0.1, 1).toFixed(1)+'mg X '+Random.integer(5, 10).toFixed(1)+'ml',
			factory: Random.cword(2, 5),
			batchnumber: Random.string('number', 20),
			validity: Random.integer(3, 36),
			location: Random.integer(3, 36),
			productdate: Random.date('yyyy-MM-dd'),
			outdate: Random.date('yyyy-MM-dd'),
			unitprice: Random.integer(5, 150),
			num: Random.integer(200, 1000),
			smnum: Random.integer(200, 1000),
			qualityStatus: Random.boolean() ? 'Y' : 'N',
			price: Random.integer(1000, 10000)
		}
		
		medlist.push(attr);
	}

  return {
  	status: '0',
    data: medlist
  }
}

const zBatchresetSave = function () {
  return {
  	status: '0',
    data: {}
  }
}

const zBatchNoSearch = function () {
	let arr = [];
	const len = Random.integer(0, 10);
	for (let i = 0; i < len; i++) {
		let attr = {
			id: Random.id(),
			name: Random.string('number', 20),
			validity: Random.integer(3, 36),
			productdate: Random.date('yyyy-MM-dd'),
			outdate: Random.date('yyyy-MM-dd'),
		}
		arr.push(attr)
	}

  return {
  	status: '0',
    data: arr
  }
}

const zQualityresetByCode = function () {
	let arr = [];
	const len = Random.integer(0, 10);
	for (let i = 0; i < len; i++) {
		let attr = {
			id: Random.id(),
			name: '药品'+Random.integer(11, 20),
			specifications: Random.float(0.1, 1).toFixed(1)+'mg X '+Random.integer(5, 10).toFixed(1)+'ml',
			factory: Random.cword(2, 5),
			batchnumber: Random.string('number', 20),
			validity: Random.integer(3, 36),
			productdate: Random.date('yyyy-MM-dd'),
			unitprice: Random.integer(5, 150),
			num: Random.integer(200, 1000),
			smnum: Random.integer(200, 1000),
			qualityStatus: Random.boolean() ? 'Y' : 'N',
			price: Random.integer(1000, 10000)
		}
		arr.push(attr)
	}
	
	return {
		status: '0',
	  data: arr
	}
}

const zQualityresetSave = function () {
  return {
  	status: '0',
    data: {}
  }
}

const zSupervisoryByCode = function () {
	let arr = [];
	const len = Random.integer(0, 10);
	for (let i = 0; i < len; i++) {
		let attr = {
			id: Random.id(),
			name: '药品'+Random.integer(11, 20),
			specifications: Random.float(0.1, 1).toFixed(1)+'mg X '+Random.integer(5, 10).toFixed(1)+'ml',
			factory: Random.cword(2, 5),
			batchnumber: Random.string('number', 20),
			validity: Random.integer(3, 36),
			productdate: Random.date('yyyy-MM-dd'),
			unitprice: Random.integer(5, 150),
			num: Random.integer(200, 1000),
			supervisoryCode: Random.string('number', 8),
			price: Random.integer(1000, 10000)
		}
		arr.push(attr)
	}
	
	return {
		status: '0',
	  data: arr
	}
}

const zSupervisorySave = function () {
  return {
  	status: '0',
    data: {}
  }
}

const zInventoryplanList = function () {
	let arr = [];
	const len = Random.integer(0, 10);
	for (let i = 0; i < len; i++) {
		let attr = {
			id: Random.id(),
			pandianname: Random.string('number', 28),
			plandate: Random.date('yyyy-MM-dd'),
			medStoreId: Random.string('number', 8),
			billstatus: Random.boolean() ? '' : '已失效',
			medstorename: '药库'+Random.cword(2, 5)
		}
		arr.push(attr)
	}
	
	return {
		status: '0',
	  data: {
			total: 20,
			list: arr
		}
	}
}

const zInventoryplanSave = function () {
  return {
  	status: '0',
    data: {
			planId: Random.string('number', 8)
		}
  }
}

const zInventoryByCode = function () {
	let arr = [];
	const len = Random.integer(0, 10);
	for (let i = 0; i < len; i++) {
		let attr = {
			id: Random.id(),
			name: '药品'+Random.integer(11, 20),
			specifications: Random.float(0.1, 1).toFixed(1)+'mg X '+Random.integer(5, 10).toFixed(1)+'ml',
			factory: Random.cword(2, 5),
			batchnumber: Random.string('number', 20),
			validity: Random.integer(3, 36),
			productdate: Random.date('yyyy-MM-dd'),
			unitprice: Random.integer(5, 150),
			num: Random.integer(200, 1000),
			smnum: Random.integer(200, 1000),
			price: Random.integer(1000, 10000),
			invoiceCode: Random.string('number', 8),
			drugStorage: '药库'+Random.cword(2, 5)
		}
		arr.push(attr)
	}

  return {
  	status: '0',
    data: arr
  }
}

const zInventorySave = function () {
  return {
  	status: '0',
    data: {}
  }
}

const zDrugDispByCode = function () {	
	let arr = [];
	const len = Random.integer(1, 10); 
	for (let i = 0; i < len; i++) {
		let attr = {
			id: Random.id(),
			name: '药品'+Random.integer(11, 20),
			specifications: Random.float(0.1, 1).toFixed(1)+'mg X '+Random.integer(5, 10).toFixed(1)+'ml',
			factory: Random.cword(2, 5),
			batchnumber: Random.string('number', 20),
			validity: Random.integer(3, 36),
			productdate: Random.date('yyyy-MM-dd'),
			unitprice: Random.integer(5, 150),
			num: Random.integer(200, 1000),
			smnum: Random.integer(200, 1000),
			qualityStatus:'质量状态'+Random.cword(2, 5),
			locatno:'货位'+Random.cword(2, 5),
			billcode:'单号'+Random.cword(2, 5),
			drugStorage: '药库'+Random.cword(2, 5)
		}
		arr.push(attr)
	}	
	return {
		status: '0',
	  data: {
		
			list: arr
		}
	}
}

const zDrugDispSave = function () {
  return {
  	status: '0',
    data: {}
  }
}

const zLogin = function () {
	let pid = Random.id();
  return {
  	status: '0',
    data: pid
  }
}

const zDrugoutList = function () {
	let arr = [];
	for(let j = 0; j < 5; j++) {
		let _obj = {
			code: Random.string('number', 8),
			price: Random.integer(1000, 10000),
			company: Random.cword(2, 5),
			reviewman: Random.cword(2, 5),
			status: [0,1,2][Random.integer(0,2)],
			smdate: Random.date('yyyy-MM-dd'),
			medlist: []
		}
		const len = Random.integer(0, 10);
		for (let i = 0; i < len; i++) {
		  let attr = {
		  	name: '药品'+Random.integer(11, 20),
		  	specifications: Random.float(0.1, 1).toFixed(1)+'mg X '+Random.integer(5, 10).toFixed(1)+'ml',
		  	factory: Random.cword(2, 5),
		  	batchnumber: Random.string('number', 20),
		  	validity: Random.integer(3, 36),
		  	productdate: Random.date('yyyy-MM-dd'),
		  	unitprice: Random.integer(5, 150),
		  	num: Random.integer(200, 1000),
		  	price: Random.integer(1000, 10000),
				location: Random.integer(3, 36),
		  }
		  _obj.medlist.push(attr)
		}
		arr.push(_obj);
	}

  return {
  	status: '0',
    data: {
			total: 10,
			list: arr
		}
  }
}

const zDrugOutByCode = function () {	
	let arr = [];
	const len = Random.integer(0, 10);
	for (let i = 0; i < len; i++) {
		let attr = {
			id: Random.id(),
			name: '药品'+Random.integer(11, 20),
			specifications: Random.float(0.1, 1).toFixed(1)+'mg X '+Random.integer(5, 10).toFixed(1)+'ml',
			factory: Random.cword(2, 5),
			batchnumber: Random.string('number', 20),
			validity: Random.integer(3, 36),
			productdate: Random.date('yyyy-MM-dd'),
			unitprice: Random.integer(5, 150),
			num: Random.integer(200, 1000),
			smnum: Random.integer(200, 1000),
			locatno:'货位'+Random.cword(2, 5),
			billcode:'单号'+Random.cword(2, 5),
			drugStorage: '药库'+Random.cword(2, 5)
		}
		arr.push(attr)
	}
	
	return {
		status: '0',
	  data: arr
	}
}

const zDrugOutSave = function () {
  return {
  	status: '0',
    data: {}
  }
}

const zDruginList = function () {
	let arr = [];
	for(let j = 0; j < 5; j++) {
		let _obj = {
			code: Random.string('number', 8),
			price: Random.integer(1000, 10000),
			company: Random.cword(2, 5),
			reviewman: Random.cword(2, 5),
			status: [0,1,2][Random.integer(0,2)],
			smdate: Random.date('yyyy-MM-dd'),
			medlist: []
		}
		const len = Random.integer(0, 10);
		for (let i = 0; i < len; i++) {
		  let attr = {
		  	name: '药品'+Random.integer(11, 20),
		  	specifications: Random.float(0.1, 1).toFixed(1)+'mg X '+Random.integer(5, 10).toFixed(1)+'ml',
		  	factory: Random.cword(2, 5),
		  	batchnumber: Random.string('number', 20),
		  	validity: Random.integer(3, 36),
		  	productdate: Random.date('yyyy-MM-dd'),
		  	unitprice: Random.integer(5, 150),
		  	num: Random.integer(200, 1000),
		  	price: Random.integer(1000, 10000),
				location: Random.integer(3, 36),
		  }
		  _obj.medlist.push(attr)
		}
		arr.push(_obj);
	}

  return {
  	status: '0',
    data: {
			total: 10,
			list: arr
		}
  }
}

const zDrugInByCode = function () {
	let arr = [];
	const len = Random.integer(0, 10);
	for (let i = 0; i < len; i++) {
		let attr = {
			id: Random.id(),
			name: '药品'+Random.integer(11, 20),
			specifications: Random.float(0.1, 1).toFixed(1)+'mg X '+Random.integer(5, 10).toFixed(1)+'ml',
			factory: Random.cword(2, 5),
			batchnumber: Random.string('number', 20),
			validity: Random.integer(3, 36),
			productdate: Random.date('yyyy-MM-dd'),
			unitprice: Random.integer(5, 150),
			num: Random.integer(200, 1000),
			smnum: Random.integer(200, 1000),
  		locatno:'货位'+Random.cword(2, 5),
  		billcode:'单号'+Random.cword(2, 5),
  		drugStorage: '药库'+Random.cword(2, 5)
		}
		arr.push(attr)
	}
	
	return {
		status: '0',
	  data: arr
	}
}

const zDrugInSave = function () {
  return {
  	status: '0',
    data: {}
  }
}

const zInventoryList = function () {
	let arr = [];
	for (let i = 0; i < 5; i++) {
		let attr = {
			planId: Random.id(),
			planName: '盘点单号'+Random.integer(11, 20),
			storeId: Random.id(100),
			storeName: '药库'+Random.integer(11, 20),
			druglist: []
		}
		for (let j = 0; j < 5; j++) {
			let _attr = {
				id: Random.id(),
				name: '药品'+Random.integer(11, 20),
				specifications: Random.float(0.1, 1).toFixed(1)+'mg X '+Random.integer(5, 10).toFixed(1)+'ml',
				factory: Random.cword(2, 5),
				reviewman: Random.cword(2, 5),
				batchnumber: Random.string('number', 20),
				validity: Random.integer(3, 36),
				jwcode: Random.integer(3, 36),
				productdate: Random.date('yyyy-MM-dd'),
				unitprice: Random.integer(5, 150),
				num: Random.integer(200, 1000),
				smnum: Random.integer(200, 1000),
				price: Random.integer(1000, 10000),
				invoiceCode: Random.string('number', 8),
				status: Random.boolean() ? 'Y' : 'N',
				drugStorage: '药库'+Random.cword(2, 5)
			}
			
			attr.druglist.push(_attr);
		}
		arr.push(attr);
	}

  return {
  	status: '0',
    data: {
			total: 10,
			list: arr
		}
  }
}

const zmaterialInScanByCode = function () {
  let arr = [];
  const len = Random.integer(1, 2); 
  for (let i = 0; i < len; i++) {
  	let attr = {
  		id: Random.id(),
  		name: '药品'+Random.integer(11, 20),
  		specifications: Random.float(0.1, 1).toFixed(1)+'mg X '+Random.integer(5, 10).toFixed(1)+'ml',
  		factory: Random.cword(2, 5),
  		batchnumber: Random.string('number', 20),
  		validity: Random.integer(3, 36),
  		productdate: Random.date('yyyy-MM-dd'),
  		unitprice: Random.integer(5, 150),
  		num: Random.integer(200, 1000),
  		smnum: Random.integer(100, 100),
  		qualityStatus:'质量状态'+Random.cword(2, 5),
  		locatno:'货位'+Random.cword(2, 5),
  		billcode:'单号'+Random.cword(2, 5),
  		drugStorage: '药库'+Random.cword(2, 5)
  	}
  	arr.push(attr)
  }
  return {
  	status: '0',
    data: {
  		list: arr
  	}
  }
}

const zmaterialScanByCode = function () {
  let arr = [];
  const len = Random.integer(1, 2); 
  for (let i = 0; i < len; i++) {
  	let attr = {
  		id: Random.id(),
  		name: '药品'+Random.integer(11, 20),
  		specifications: Random.float(0.1, 1).toFixed(1)+'mg X '+Random.integer(5, 10).toFixed(1)+'ml',
  		factory: Random.cword(2, 5),
  		batchnumber: Random.string('number', 20),
  		validity: Random.integer(3, 36),
  		productdate: Random.date('yyyy-MM-dd'),
  		unitprice: Random.integer(5, 150),
  		num: Random.integer(200, 1000),
  		smnum: Random.integer(100, 100),
  		qualityStatus:'质量状态'+Random.cword(2, 5),
  		locatno:'货位'+Random.cword(2, 5),
  		billcode:'单号'+Random.cword(2, 5),
  		drugStorage: '药库'+Random.cword(2, 5)
  	}
  	arr.push(attr)
  }
  return {
  	status: '0',
    data: {
  		list: arr
  	}
  }
}

const zmaterialInByCode = function () {
	let arr = [];
	const len = Random.integer(0, 10);
	for (let i = 0; i < len; i++) {
		let attr = {
			id: Random.id(),
			name: '药品'+Random.integer(11, 20),
			specifications: Random.float(0.1, 1).toFixed(1)+'mg X '+Random.integer(5, 10).toFixed(1)+'ml',
			factory: Random.cword(2, 5),
			batchnumber: Random.string('number', 20),
			validity: Random.integer(3, 36),
			productdate: Random.date('yyyy-MM-dd'),
			unitprice: Random.integer(5, 150),
			num: Random.integer(200, 1000),
			smnum: Random.integer(100, 100),
  		locatno:'货位'+Random.cword(2, 5),
  		billcode:'单号'+Random.cword(2, 5),
  		drugStorage: '药库'+Random.cword(2, 5)
		}
		arr.push(attr)
	}
	
	return {
		status: '0',
	  data: arr
	}
}

const zmaterialInSave = function () {
  return {
  	status: '0',
    data: {}
  }
}

const zmaterialOutByCode = function () {	
	let arr = [];
	const len = Random.integer(0, 10);
	for (let i = 0; i < len; i++) {
		let attr = {
			id: Random.id(),
			name: '药品'+Random.integer(11, 20),
			specifications: Random.float(0.1, 1).toFixed(1)+'mg X '+Random.integer(5, 10).toFixed(1)+'ml',
			factory: Random.cword(2, 5),
			batchnumber: Random.string('number', 20),
			validity: Random.integer(3, 36),
			productdate: Random.date('yyyy-MM-dd'),
			unitprice: Random.integer(5, 150),
			num: Random.integer(200, 1000),
			smnum: Random.integer(100, 100),
			locatno:'货位'+Random.cword(2, 5),
			billcode:'单号'+Random.cword(2, 5),
			drugStorage: '药库'+Random.cword(2, 5)
		}
		arr.push(attr)
	}
	
	return {
		status: '0',
	  data: arr
	}
}

const zmaterialOutSave = function () {
  return {
  	status: '0',
    data: {}
  }
}

const zJwList = function () {
	let arr = [];
	const len = Random.integer(1, 10);
	for (let i = 0; i < len; i++) {
		let attr = {
			id: Random.id(),
			name: '架位'+Random.cword(2, 5),
		}
		arr.push(attr)
	}

  return {
  	status: '0',
    data: arr
  }
}

const zCategorycodeSave = function () {
  return {
  	status: '0',
    data: ''
  }
}

const zCategorycodeList = function () {
	let arr = [];
	let levelList = ['小包装', '中包装', '大包装'];
	let type = ['药监码', '条形码'];
	for (let i = 0; i < 5; i++) {
		let attr = {
			id: Random.id(),
			categorycode: Random.id(),
			levelDes: levelList[Random.integer(0, levelList.length-1)],
			type: type[Random.integer(0, type.length-1)],
			name: '药品'+Random.integer(11, 20),
			specifications: Random.float(0.1, 1).toFixed(1)+'mg X '+Random.integer(5, 10).toFixed(1)+'ml',
			factory: Random.cword(2, 5),
			reviewman: Random.cword(2, 5),
			batchnumber: Random.string('number', 20),
			validity: Random.integer(3, 36),
			productdate: Random.date('yyyy-MM-dd'),
			unitprice: Random.integer(5, 150),
			num: Random.integer(200, 1000),
			smnum: Random.integer(200, 1000),
			price: Random.integer(1000, 10000),
			invoiceCode: Random.string('number', 8),
			status: Random.boolean() ? 'Y' : 'N',
			drugStorage: '药库'+Random.cword(2, 5)
		}
		arr.push(attr);
	}

  return {
  	status: '0',
    data: {
			total: 10,
			list: arr
		}
  }
}

const zCategorycodeById = function () {
	let attr = {
		id: Random.id(),
		name: '药品'+Random.integer(11, 20),
		commonname: Random.cname(3, 10),
		specifications: Random.float(0.1, 1).toFixed(1)+'mg X '+Random.integer(5, 10).toFixed(1)+'ml',
		factory: Random.cword(2, 5),
		reviewman: Random.cword(2, 5),
		batchnumber: Random.string('number', 20),
		validity: Random.integer(3, 36),
		productdate: Random.date('yyyy-MM-dd'),
		unitprice: Random.integer(5, 150),
		num: Random.integer(200, 1000),
		smnum: Random.integer(200, 1000),
		price: Random.integer(1000, 10000),
		invoiceCode: Random.string('number', 8),
		status: Random.boolean() ? 'Y' : 'N',
		drugStorage: '药库'+Random.cword(2, 5),
		jwcode: Random.cword(2, 5),
	}
	
  return {
  	status: '0',
    data: attr
  }
}

const zStoreDrugOutList = function () {
	let arr = [];
	const len = Random.integer(0, 10);
	for (let i = 0; i < len; i++) {
		let attr = {
			id: Random.id(),
			name: '药品'+Random.integer(11, 20),
			specifications: Random.float(0.1, 1).toFixed(1)+'mg X '+Random.integer(5, 10).toFixed(1)+'ml',
			factory: Random.cword(2, 5),
			batchnumber: Random.string('number', 20),
			validity: Random.integer(3, 36),
			productdate: Random.date('yyyy-MM-dd'),
			unitprice: Random.integer(5, 150),
			num: Random.integer(200, 1000),
			smnum: Random.integer(200, 1000),
			price: Random.integer(1000, 10000),
			invoiceCode: Random.string('number', 8),
			drugStorage: '药库'+Random.cword(2, 5)
		}
		arr.push(attr)
	}

  return {
  	status: '0',
    data: arr
  }
}

const zProcessList = function () {
	let arr = [];
	const len2 = Random.integer(0, 10);
	for (let k = 0; k < len2; k++) {
		
		let attr = {
			id: Random.id(),
			billTotal: Random.integer(3, 36),
			goodsNum: Random.integer(3, 36),
			confimNum: Random.integer(3, 36),
			unconfimNum: Random.integer(3, 36),
			list: []
		}
		
		const len = Random.integer(0, 3);
		for (let i = 0; i < len; i++) {
			let _attr = {
				id: Random.id(),
				factory: Random.cword(2, 5),
				goodsNum: Random.integer(3, 36),
				confimNum: Random.integer(3, 36),
				unconfimNum: Random.integer(3, 36),
			}
			attr.list.push(_attr)
		}
		
		arr.push(attr);
	}
	return {
		status: '0',
	  data: {
			total: 10,
			list: arr
		}
	}
}

const zUnconfimRepList = function () {
let arr = [];
	for (let i = 0; i < 5; i++) {
		let attr = {
			id: Random.id(),
			druglist: []
		}
		for (let j = 0; j < 5; j++) {
			let _attr = {
				id: Random.id(),
				name: '药品'+Random.integer(11, 20),
				specifications: Random.float(0.1, 1).toFixed(1)+'mg X '+Random.integer(5, 10).toFixed(1)+'ml',
				factory: Random.cword(2, 5),
				reviewman: Random.cword(2, 5),
				batchnumber: Random.string('number', 20),
				validity: Random.integer(3, 36),
				jwcode: Random.integer(3, 36),
				productdate: Random.date('yyyy-MM-dd'),
				unitprice: Random.integer(5, 150),
				num: Random.integer(200, 1000),
				smnum: Random.integer(200, 1000),
				price: Random.integer(1000, 10000),
				invoiceCode: Random.string('number', 8),
				status: Random.boolean() ? 'Y' : 'N',
				drugStorage: '药库'+Random.cword(2, 5)
			}
			
			attr.druglist.push(_attr);
		}
		arr.push(attr);
	}

  return {
  	status: '0',
    data: {
			total: 10,
			list: arr
		}
  }
}

const zAllRepList = function () {
let arr = [];
	for (let i = 0; i < 5; i++) {
		let attr = {
			id: Random.id(),
			druglist: []
		}
		for (let j = 0; j < 5; j++) {
			let _attr = {
				id: Random.id(),
				name: '药品'+Random.integer(11, 20),
				specifications: Random.float(0.1, 1).toFixed(1)+'mg X '+Random.integer(5, 10).toFixed(1)+'ml',
				factory: Random.cword(2, 5),
				reviewman: Random.cword(2, 5),
				batchnumber: Random.string('number', 20),
				validity: Random.integer(3, 36),
				jwcode: Random.integer(3, 36),
				productdate: Random.date('yyyy-MM-dd'),
				unitprice: Random.integer(5, 150),
				num: Random.integer(200, 1000),
				smnum: Random.integer(200, 1000),
				price: Random.integer(1000, 10000),
				invoiceCode: Random.string('number', 8),
				status: Random.boolean() ? 'Y' : 'N',
				drugStorage: '药库'+Random.cword(2, 5)
			}
			
			attr.druglist.push(_attr);
		}
		arr.push(attr);
	}

  return {
  	status: '0',
    data: {
			total: 10,
			list: arr
		}
  }
}

const zConfimRepList = function () {
let arr = [];
	for (let i = 0; i < 5; i++) {
		let attr = {
			id: Random.id(),
			druglist: []
		}
		for (let j = 0; j < 5; j++) {
			let _attr = {
				id: Random.id(),
				name: '药品'+Random.integer(11, 20),
				specifications: Random.float(0.1, 1).toFixed(1)+'mg X '+Random.integer(5, 10).toFixed(1)+'ml',
				factory: Random.cword(2, 5),
				reviewman: Random.cword(2, 5),
				batchnumber: Random.string('number', 20),
				validity: Random.integer(3, 36),
				jwcode: Random.integer(3, 36),
				productdate: Random.date('yyyy-MM-dd'),
				unitprice: Random.integer(5, 150),
				num: Random.integer(200, 1000),
				smnum: Random.integer(200, 1000),
				price: Random.integer(1000, 10000),
				invoiceCode: Random.string('number', 8),
				status: Random.boolean() ? 'Y' : 'N',
				drugStorage: '药库'+Random.cword(2, 5)
			}
			
			attr.druglist.push(_attr);
		}
		arr.push(attr);
	}

  return {
  	status: '0',
    data: {
			total: 10,
			list: arr
		}
  }
}

const zNoCategorycodeList = function () {
	let arr = [];
	let levelList = ['小包装', '中包装', '大包装'];
	let type = ['药监码', '条形码'];
	for (let i = 0; i < 5; i++) {
		let attr = {
			id: Random.id(),
			categorycode: Random.id(),
			levelDes: levelList[Random.integer(0, levelList.length-1)],
			type: type[Random.integer(0, type.length-1)],
			name: '药品'+Random.integer(11, 20),
			specifications: Random.float(0.1, 1).toFixed(1)+'mg X '+Random.integer(5, 10).toFixed(1)+'ml',
			factory: Random.cword(2, 5),
			reviewman: Random.cword(2, 5),
			batchnumber: Random.string('number', 20),
			validity: Random.integer(3, 36),
			productdate: Random.date('yyyy-MM-dd'),
			unitprice: Random.integer(5, 150),
			num: Random.integer(200, 1000),
			smnum: Random.integer(200, 1000),
			price: Random.integer(1000, 10000),
			invoiceCode: Random.string('number', 8),
			status: Random.boolean() ? 'Y' : 'N',
			drugStorage: '药库'+Random.cword(2, 5)
		}
		arr.push(attr);
	}

  return {
  	status: '0',
    data: {
			total: 10,
			list: arr
		}
  }
}

const zhospMedOutByCode = function () {	
	let arr = [];
	const len = Random.integer(1, 3);
	for (let i = 0; i < len; i++) {
		let batchnumberList = [];
		const len2 = Random.integer(1, 2);
		for (let j=0; j<len2; j++){
			let s = {
				locatno:'货位'+Random.cword(2, 5),
				locatnoS: Random.cword(1, 2),
				batchnumber: Random.string('number', 10),
				validity: Random.date('yyyy-MM-dd'),
				smnum: 0,
			}
			batchnumberList.push(s);
		}
		let attr = {
			id: Random.id(),
			name: '药品'+Random.integer(11, 20),
			specifications: Random.float(0.1, 1).toFixed(1)+'mg X '+Random.integer(5, 10).toFixed(1)+'ml',
			factory: Random.cword(2, 5),
			productdate: Random.date('yyyy-MM-dd'),
			unitprice: Random.integer(5, 150),
			num: Random.integer(200, 1000),
			billcode:'单号'+Random.cword(2, 5),
			unit: Random.cword(2, 5),
			drugStorageId: '640000198006198288',
			batchlist: batchnumberList
		}
		arr.push(attr)
	}
	
	let keshi = {
		id: Random.string('number', 10),
		name: '科室'+Random.cword(2, 5)
	}
	
	return {
		status: '0',
	  data: {
			list: arr,
			keshi: keshi
		}
	}
}

const zhospMedOutScanByCode = function () {
  let arr = [];
  let attr = {
  	id: Random.id(),
  	name: '药品'+Random.integer(11, 20),
  	specifications: Random.float(0.1, 1).toFixed(1)+'mg X '+Random.integer(5, 10).toFixed(1)+'ml',
  }
  return {
  	status: '0',
    data: attr
  }
}

const zhospMedOutOutSave = function () {
  return {
  	status: '0',
    data: {}
  }
}

const zhospMedOutHistList = function () {
	let arr = [];
	for(let j = 0; j < 5; j++) {
		
		let _obj = {
			code: Random.string('number', 8),
			price: Random.integer(1000, 10000),
			company: Random.cword(2, 5),
			reviewman: Random.cword(2, 5),
			status: [0,1,2][Random.integer(0,2)],
			smdate: Random.date('yyyy-MM-dd'),
			medlist: [],
			keshi: '科室'+Random.cword(2, 5)
		}
		const len = Random.integer(0, 10);
		for (let i = 0; i < len; i++) {
		  let attr = {
		  	name: '药品'+Random.integer(11, 20),
		  	specifications: Random.float(0.1, 1).toFixed(1)+'mg X '+Random.integer(5, 10).toFixed(1)+'ml',
		  	factory: Random.cword(2, 5),
		  	batchnumber: Random.string('number', 20),
		  	validity: Random.integer(3, 36),
		  	productdate: Random.date('yyyy-MM-dd'),
		  	unitprice: Random.integer(5, 150),
		  	num: Random.integer(200, 1000),
		  	price: Random.integer(1000, 10000),
				location: Random.integer(3, 36),
		  }
		  _obj.medlist.push(attr)
		}
		arr.push(_obj);
	}
	
  return {
  	status: '0',
    data: {
			total: 10,
			list: arr
		}
  }
}

const zStroeDrugNums = function () {
	let batchnumberList = [];
	const len2 = Random.integer(1, 2);
	for (let j=0; j<len2; j++){
		let s = {
			locatno:'货位'+Random.cword(2, 5),
			locatnoS: Random.cword(1, 2),
			batchnumber: Random.string('number', 10),
			validity: Random.date('yyyy-MM-dd'),
			smnum: 0,
		}
		batchnumberList.push(s);
	}
	
  return {
  	status: '0',
    data: batchnumberList
  }
}

const zNoma = function () {
  return {
  	status: '0',
    data: {}
  }
}

module.exports = function() {
	var data = {};
	
	data.ztest = ztest();
	data.invoiceByCode = zInvoiceByCode();
	data.invoiceSave = zInvoiceSave();
	data.invoiceByList = zInvoiceList();
	data.supplierList = zSupplierList();
	data.medcheckByCode = zMedcheckByCode();
	data.medcheckSave = zMedcheckSave();
	data.medcheckList = zMedcheckList();
	data.drugStorageList = zDrugStorageList();
	data.checkresList = zCheckresList();
	data.batchresetByCode = zBatchresetByCode();
	data.zBatchresetSave = zBatchresetSave();
	data.batchNoSearch = zBatchNoSearch();
	data.qualityresetByCode = zQualityresetByCode();
	data.zQualityresetSave = zQualityresetSave();
	data.zSupervisoryByCode = zSupervisoryByCode();
	data.zSupervisorySave = zSupervisorySave();
	data.inventoryplanList = zInventoryplanList();
	data.inventoryplanSave = zInventoryplanSave();
	data.inventoryByCode = zInventoryByCode();
	data.zInventorySave = zInventorySave();
	data.drugDispByCode = zDrugDispByCode();
	data.drugDispSave = zDrugDispSave();
	data.baseLogin = zLogin();
	data.drugoutList = zDrugoutList();
	data.drugOutByCode = zDrugOutByCode();
	data.drugOutSave = zDrugOutSave();
	data.drugInByCode = zDrugInByCode();
	data.drugInSave = zDrugInSave();
	data.druginList = zDruginList();
	data.inventoryList = zInventoryList();
	data.materialOutByCode = zmaterialOutByCode();
	data.materialScanByCode = zmaterialScanByCode();
	data.materialOutSave = zmaterialOutSave();
	data.materialInByCode = zmaterialInByCode();
	data.materialInScanByCode = zmaterialInScanByCode();
	data.zJwList = zJwList();
	data.zCategorycodeSave = zCategorycodeSave();
	data.zCategorycodeList = zCategorycodeList();
	data.medcheckAllList = zMedcheckList();
	data.zCategorycodeById = zCategorycodeById();
	data.zNoma = zNoma();
	data.zOutStoreList = zOutStoreList();
	data.zStoreDrugOutList = zStoreDrugOutList();
	data.zProcessList = zProcessList();
	data.zUnconfimRepList = zUnconfimRepList();
	data.zAllRepList = zAllRepList();
	data.zConfimRepList = zConfimRepList();
	data.zNoCategorycodeList = zNoCategorycodeList();
	
	data.zhospMedOutByCode = zhospMedOutByCode();
	data.zhospMedOutScanByCode = zhospMedOutScanByCode();
	data.zhospMedOutOutSave = zhospMedOutOutSave();
	data.zhospMedOutHistList = zhospMedOutHistList();
	
	data.zStroeDrugNums = zStroeDrugNums();

	return data;
}
